package com.zestinn.smart4j.framework.util;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;

import java.util.Collection;
import java.util.Map;

/**
 * 集合判断类
 * @author zestinn
 * @create 2017-09-22 09:28
 */
public final class CollectionUtil {

    /**
     * 判断集合是否不为空
     */
    public static boolean isNotEmpty(Collection c){
        return CollectionUtils.isNotEmpty(c);
    }

    /**
     * 判断Map是否不为空
     */
    public static boolean isNotEmpty(Map map){
        return MapUtils.isNotEmpty(map);
    }

    /**
     * 判断集合是否为空
     */
    public static boolean isEmpty(Collection c) {
        return !CollectionUtils.isNotEmpty(c);
    }

    /**
     * 判断Map是否为空
     */
    public static boolean isEmpty(Map map) {
        return MapUtils.isEmpty(map);
    }
}
